<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePlatformCreditsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('platform_credits', function (Blueprint $table) {
//            $table->comment('dec平台学分');
            $table->increments('id')->comment('ID');
            $table->string('record_id', 16)->default('')->comment('平台id');
            $table->bigInteger('user_id')->default(0)->comment('userId数据');
            $table->string('id_card', 20)->default('')->comment('身份证');
            $table->string('user_name', 32)->default('')->comment('用户名称');
            $table->string('term', 64)->default('')->comment('时期');
            $table->integer('term_dic')->default(0)->comment('时期关联字典id');
            $table->string('course_name', 255)->default('')->comment('课程名称');
            $table->string('course_type', 64)->default('')->comment('课程模块');
            $table->string('course_level', 64)->default('')->comment('课程级别');
            $table->string('course_cap', 64)->default('')->comment('课程专项能力');
            $table->double('score', null, 0)->default(0)->comment('学分');
            $table->dateTime('get_time')->nullable()->comment('获得时间');
            $table->dateTime('created_at')->nullable()->useCurrent();
            $table->dateTime('updated_at')->nullable()->useCurrent();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('platform_credits');
    }
};
